package com.example.lambda.rest;

import com.example.lambda.config.MyBean;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @date 2021/1/20 23:12
 * @desc @RequiredArgsConstructor  必须用final修饰对象，才可以注入
 */
@RestController
@RequiredArgsConstructor
public class BeanController {

    final MyBean myBean;

    @GetMapping("/bean1")
    public String bean1(){
        return myBean.test();
    }
}
